package com.haizhi.crm.sys.auth.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by yangyijun on 2018/5/17.
 */
@Data
@ApiModel
public class PositionResourcePermissionQo {

    @ApiModelProperty(value = "岗位ID", required = true)
    @NotNull(message = "岗位ID不能为空" )
    @Min(value = 1)
    private Long positionId;

    private List<ResourcePermission> resourcePermissions = new ArrayList<>();

    @Data
    public static class ResourcePermission {

        @ApiModelProperty(value = "资源ID", required = true)
        @NotNull(message = "资源ID不能为空" )
        @Min(value = 1)
        private Long resourceId;

        @ApiModelProperty(value = "权限ID", required = true)
        @NotNull(message = "权限ID不能为空" )
        @Min(value = 1)
        private Long permissionId;
    }
}
